Derivation Complexity in Context-Free Grammar Forms

نویسندگان

  • Seymour Ginsburg
  • Nancy A. Lynch
چکیده

Let F be an arbitrary context-free grammar form and (F) the family of grammars defined by F. For each grammar G in d(F), the derivation complexity function 6, on the language of G, is defined for each word x as the number of steps in a minimal G-derivation of x. It is shown that derivations may always be speeded up by any constant factor n, in the sense that for each positive integer n, an equivalent grammar G’ in (F) can be found so that ,(x)<-_lxl/n for all large words x, Ix denoting the length of x. Key words, complexity theory, grammar complexity, grammar forms Introduction. In [2] the notion of a (context-free) grammar form was introduced, to model the situation where all grammars structurally close to a master grammar are being considered. The research on grammar forms to date [2], [3], [5] has been concerned with grammatical, structural, and language-theoretic problems. The present paper initiates the study of complexity-theoretic questions. Specifically, the derivation complexity function G, defined to be the minimal number of steps in a derivation of x, is examined with respect to all grammars defined by a grammar form F. It is trivial that is at least linear and almost trivial that is, in fact, linear. Our main result asserts that derivations may be speeded up by any constant factor n, in the sense that for each positive integer n, an equivalent grammar G’ defined by F can be found so that ,(x)<-_lxl/n for all large words x, Ix denoting the length of x. The basic question underlying this work is whether among the different grammar forms yielding the same family of languages, there are some which are more efficient than others. The results of this paper show that, if length of derivation is the only criterion, there is no difference among grammar forms. As will be seen, the cost of the speedup is a large increase in the size (e.g., number of productions) of the grammars used. It remains to study the resulting trade-offs. The notion of derivation complexity was originally defined by Gladkii [6] and has been extensively studied by Book 1] for arbitrary phrase-structure grammars. Some of the results in [ 1] have a speedup flavor similar to ours, but the grammars in [1] accomplishing the speedup have structure very different from those of the original grammars. By carrying out our constructions within the framework of grammar forms, we preserve structure while speeding up derivations. The paper is divided into three sections and an Appendix. Section 1 reviews grammar form concepts, defines the derivation complexity function, and determines a lower bound for it. Section 2 is concerned with proving Proposition 2.4, a special case of the main theorem. The main result itself, Theorem 3.2, is established in 3. The proof involves first showing (Lemma 3.1) that the original grammar form may be assumed to have certain additional properties. An induction argument on the number of variables in the grammar form is then presented, * Received by the editors November 27, 1974, and in revised form December 8, 1975. " Computer Science Department, University of Southern California, Los Angeles, California 90007. This work was supported in part by a Guggenheim Fellowship and in part by National Science Foundation Grant GJ 42306. 123 D ow nl oa de d 04 /0 8/ 14 to 1 28 .3 0. 51 .5 9. R ed is tr ib ut io n su bj ec t t o SI A M li ce ns e or c op yr ig ht ; s ee h ttp :// w w w .s ia m .o rg /jo ur na ls /o js a. ph p 124 SEYMOUR GINSBURG AND NANCY LYNCH with the case for one variable being exactly the situation handled in 2. The Appendix is devoted to proving a technical combinatorial lemma, needed in 2 to verify the main theorem for each grammar form defining the family of all context-free languages. 1. Preliminaries. In this section we first review the principal ideas relating to context-free grammar forms. Then we introduce the formalism for treating derivation complexity in grammar forms. DZFINIaION. A (context-free) grammar form is a 6-tuple F= (V, , o//., oW, , r), where (i) V is an infinite set of abstract symbols, (ii) Z is an infinite subset of V such that V-Z is infinite, and (iii) Gv= (o//., 50, , r), called the form grammar (of F) is a context-free grammar with 0 _ Z and (F5e) VZ). The reader is referred to [2] for motivation and further details about grammar forms. .Throughout, V and are assumed to be fixed infinite sets satisfying conditions (i) and (ii) above. All context-free grammar forms considered here are with respect to this V and Z. Also, the adjective "context-free" is usually omitted from the expression "context-free grammar form." The purpose of a grammar form is to specify a family f grammars, each "structurally close" to the form grammar. This is accomplished by the notion of: DEFINITION. An interpretation of a grammar form F (V, 5;, F, if’, , tr) is a 5-tuple I (/z, VI, E, PI, S), where 1. /x is a substitution on * such that/x(a) is a finite subset of Z*,/x(c) is a finite subset of V-Z for each sc in o//._ if,, and/x(sc) f)/x(r/) for each : and sc r/, in 2. Pt is a subset of/z() t3 =i./x (Tr), where/z(a -/3) {u v/u in/z(a), v in/z(fl)}; 3. SI is in/z(tr); and 4. EI(VI) contains the set of all symbols in Z(V) which occur in PI (together with SI). G (Vz, , Pz, Sz) is called the grammar of I. An interpretation is usually exhibited by indicating Sz, Pt, and (implicitly or explicitly)/x. The sets V and Et are ordinarily not stated explicitly. A grammar form determines a family of grammars and a family of languages as follows: DEFINITION. For each grammar form F, (F) {Gx/I an interpretation of F} is called the family of grammars of F and (F)={L(Gt)IGI in (F)} the grammatical family of F. In this paper we are interested in studying derivation complexity in a grammar form, i.e., the derivation complexity of the grammars in (F). To do this we consider the following: We assume the reader is familiar with the basic notions pertaining to context-free grammars. Here o//. is the total alphabet, 6 is the terminal alphabet, is the set of productions, and tr is the start variable. D ow nl oa de d 04 /0 8/ 14 to 1 28 .3 0. 51 .5 9. R ed is tr ib ut io n su bj ec t t o SI A M li ce ns e or c op yr ig ht ; s ee h ttp :// w w w .s ia m .o rg /jo ur na ls /o js a. ph p CONTEXT-FREE GRAMMAR FORMS 125 Notation. For every context-free grammar G (V1, El, P, S) let a be the function on L(G) in which a(x) is the minimum number of steps among all G-derivations of x, for each x in L (G). Thus is the minimum derivation function, in the sense that a(x) is the minimum number of steps necessary to derive x. Notation. For every context-free grammar G let 4a=min{a(x)[x in L(G), x e} if G is not vacuous, and b otherwise. Thus b is the fewest number of steps needed to derive at least one non-e word in L(G). The restriction in our definition of b to non-e words is needed because of the construction used in Lemma 2.1 to make finite patches on grammars. From Lemma 2.1 of [2] we immediately get: LEMMA 1.1. For each grammar form F and each grammar G in (F), Using the above lemma we now obtain a lower bound for . PROPOSITION 1..2. LetFbe a grammarform and G in f(F). Then there exists a positive integer n so that (x) >= max {b, Ixl/n} for all x e in L(G). Proof. Let n be the largest number of terminal symbols on the right side of any production of G. Then for each x e in L(G), at least Ixl/n steps are needed

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Computation of the Probability of the Best Derivation of an Initial Substring from a Stochastic Context-Free Grammar

Recently, Stochastic Context-Free Grammars have been considered important for use in Language Modeling for Automatic Speech Recognition tasks [6, 10]. In [6], Jelinek and Lafferty presented and solved the problem of computation of the probability of initial substring generation by using Stochastic Context-Free Grammars. This paper seeks to apply a Viterbi scheme to achieve the computation of th...

متن کامل

On the Parameterized Complexity of Linear Context-Free Rewriting Systems

We study the complexity of uniform membership for Linear Context-Free Rewriting Systems, i.e., the problem where we are given a string w and a grammar G and are asked whether w ∈ L(G). In particular, we use parameterized complexity theory to investigate how the complexity depends on various parameters. While we focus primarily on rank and fan-out, derivation length is also considered.

متن کامل

Descriptional Complexity of Context-Free Grammar Forms

Csuhaj-Vajh, E. and A. Kelemenovi, Descriptional complexity of context-free grammar forms, Theoretical Computer Science 112 (1993) 277-289. Descriptional complexity aspects of grammar forms are studied. It is shown that grammatical complexity measures HEI,q, LEV,<, VAR,<, PROD,< and DEP., related to any appropriate infinite class ‘8 of grammars are unbounded on the infinite class of languages d...

متن کامل

Two Power-Decreasing Derivation Restrictions in Generalized Scattered Context Grammars

The present paper introduces and discusses generalized scattered context grammars that are based upon sequences of productions whose left-hand sides are formed by nonterminal strings, not just single nonterminals. It places two restrictions on the derivations in these grammars. More specifically, let k be a positive integer. The first restriction requires that all rewritten symbols occur within...

متن کامل

Exponential ambiguity of context-free grammars

A context-free grammar G is ambiguous if and only if there is a word that can be generated byG with at least two different derivation trees. Ambiguous grammars are often distinguished by their degree of ambiguity, which is the maximal number of derivation trees for the words generated by them. If there is no such upper bound G is said to be ambiguous of infinite degree. Here as a new tool for e...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • SIAM J. Comput.

دوره 6  شماره 

صفحات  -

تاریخ انتشار 1977